type responseType = {
	code: number;
	data: any;
	msg: string;
};

import service from '@/utils/https';

/**
 * 搭子管理 
 */
export const findPartnership = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/partnership/find-partnership-post',
		method: 'post',
		data: params,
	})
}

/**
 * 删除搭子 
 */
export const deletePartnership = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/partnership/deldete-partnership-post',
		method: 'post',
		data: params,
	})
}

/**
 * 新闻资讯 - 新闻列表
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postNewList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/article/find-article-list',
		method: 'post',
		data: params,
	})
}

/**
 * 新闻资讯 - 新增新闻
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postAddNew = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/article/save-article',
		method: 'post',
		data: params,
	})
}

/**
 * 新闻资讯 - 更新新闻
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postEditNew = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/article/update-article',
		method: 'post',
		data: params,
	})
}

/**
 * 新闻资讯 - 删除新闻
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postDeleteNew = (id?: number): Promise<responseType> => {
	return service({
		url: `system/rest/article/delete-article-by-id?articleId=${id}`,
		method: 'post',
	})
}

/**
 * 微信用户 - 列表查询
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postWechatList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/wx/user/find-user-list',
		method: 'post',
		data: params,
	})
}

/**
 * 微信用户 - 意见反馈
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postFeedList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/feed-back/find-feed-back-list',
		method: 'post',
		data: params,
	})
}

/**
 * 角色认证 - 列表查询
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postIdentityList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/wx/user/find-identity-auth-info-list',
		method: 'post',
		data: params,
	})
}

/**
 * 角色认证 - 查询认证详情
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const getIdentityDetail = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/wx/user/get-identity-auth-info',
		method: 'get',
		params,
	})
}

/**
 * 角色认证 - 身份认证审核
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postIdentityAudit = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/wx/user/user-audit',
		method: 'post',
		data: params,
	})
}

/**
 * 轮播图 - 获取
 */
export const getBannerList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/config/get-banner-config',
		method: 'get',
		params,
	})
}

export const saveBannerList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/config/save-banner-config',
		method: 'post',
		data: params,
	})
}

/**
 * 置顶文章 
 */
export const uptopArticle = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/article/untop-article',
		method: 'post',
		data: params,
	})
}

/**
 * 取消置顶
 */
export const topArticle = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/article/top-article',
		method: 'post',
		data: params,
	})
}

/**
 * 查询积分流水
 */
export const findPointsFlowList = (params?: object): Promise<responseType> => {
	return service({
		url: 'system/rest/wx/user/ponits/find-user-points-flow-list',
		method: 'post',
		data: params,
	})
}